package com.jnu.hospitalexamination.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jnu.hospitalexamination.entity.Orders;
import com.jnu.hospitalexamination.entity.vo.OrdersVO;
import com.jnu.hospitalexamination.entity.vo.UserOrderVO;
import com.jnu.hospitalexamination.service.OrdersService;
import com.jnu.hospitalexamination.mapper.OrdersMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;

/**
* @author Nowonder
* @description 针对表【orders】的数据库操作Service实现
* @createDate 2024-07-21 23:01:59
*/
@Service
public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, Orders>
    implements OrdersService{
    @Autowired
    private OrdersMapper ordersMapper;

    /**
     * 根据医院ID和日期获取当天预约人数
     * @param hpId 医院ID
     * @param orderDate 预约日期
     * @return 当天预约人数
     */
    @Override
    public Integer getOrderNum(Integer hpId, LocalDate orderDate) {
        return ordersMapper.getOrderNum(hpId,orderDate);
    }

    @Override
    public List<OrdersVO> getOrderList(Integer userid) {
        return ordersMapper.getOrderList(userid);
    }
    @Override
    public List<UserOrderVO> getUserOrderList(){ return ordersMapper.getUserOrderList();}
}




